package by.blog.dao.dao.factory;

import by.blog.dao.dao.DaoCategory;
import by.blog.dao.dao.DaoUser;
import by.blog.dao.dao.DaoCategory;
import by.blog.dao.dao.DaoFilm;
import by.blog.dao.dao.DaoUser;

import java.sql.Connection;

/**
 * Бондарчик Антон  15.11.2014.
 */


public abstract class DaoFactory {
    public static final int mysql = 1;
    public static final int oracle = 2;

    public abstract DaoFilm getDaoFilm();
    public abstract DaoUser getDaoUser();
    public abstract DaoCategory getDaoCategory();

    public abstract Connection createConnection();

    public static DaoFactory getDAOFactory(int WHATAFACTORY) {
        try {
            switch (WHATAFACTORY) {
                case mysql:
                //    return new MysqlDaoFactory();
                //case oracle:
                //return new OracleDAOFactory();
                default:
                    return null;
            }
        }
        catch (NullPointerException e) {
            return null;
        }
    }

}
